<include file="Public:header"/>			
<div id="content">
<div id="content-header">
	<h1>用户列表</h1>
	<div class="btn-group">
		<a href="{:U('Admin/User/userAdd')}" class="btn btn-large" title="新增用户"><i class="fa fa-file"></i></a>
	</div>
</div>
<div id="breadcrumb">
	<a href="#" title="回到首页" class="tip-bottom"><i class="fa fa-home"></i> 首页</a>
	<a href="#" class="current">用户列表</a>
</div>
	<div class="row">
		<div class="col-xs-12">		
			<div class="widget-box">
				<div class="widget-title">
					<span class="icon">
						<i class="fa fa-th"></i>
					</span>
					<h5>用户列表</h5>
					<span class="label label-info">{$num} 条 </span>
				</div>
				<div class="widget-content">
					<table class="table table-bordered table-striped table-hover">
						<thead>
							<tr>
								<th width="5%">编号</th>
								<th width="15%">登陆用户名</th>
								<th	width="15%">权限组</th>
								<th width="20%">联系邮箱</th>
								<th width="20%">添加时间</th>
								<th width="20%">操作</th>
							</tr>
						</thead>
						<tbody>
							<volist name="list" id="k">
							<tr>
								<td class="id">{$k.u_id}</td>
								<td>{$k.u_name}</td>
								<td>
									<switch name="k['u_class']">
										<case value="1">最高管理员</case>
										<case value="2">普通管理员</case>
										<default />普通用户
									</switch>
								</td>
								<td>{$k.u_email}</td>
								<td>{$k.u_time}</td>
								<td>
									<a class="btn btn-success btn-sm" href="{:U('/Admin/User/userEdit',array('id'=>$k['u_id']))}">编辑</a>&nbsp;&nbsp;
									<button class="btn btn-danger btn-sm deluser">删除</button>
								</td>
							</tr>
							</volist>	
						</tbody>
					</table>
					{$page}
				</div>
			</div>
		</div>
	</div>
</div>
<include file="Public:footer"/> 
    <script>
    $(document).ready(function(){
    	$(".deluser",this).click(function(){
    		var id = $(this).parents("tr").find(".id").text();
    		$(".deluser").attr("disabled",true);
    		$.ajax({
    			type:"post",
    			url:"/Admin/User/userDel",
    			async:true,
    			data:{"id":id},
    			success:function(data){
    				if(data.error==0){
    					succ("完成!",data.msg,"__SELF__");
    				}else{
    					err("错误!",data.msg);
    					$(".deluser").removeAttr('disabled');
    				}
    			},
    		});
    	});
    });
    </script>
</body>
</html>
